Skip to content

Changed AdditionalSketchFilesCopier legacy command into new builder API function #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 30, 2019

Conversation

masci
Copy link
Contributor

@masci masci commented Jul 19, 2019

Part of the ongoing refactoring of the legacy package.

Also changed few functions names in the new API to match the convention builder.Sketch* to better group parts of the API that operates on specific objects like a Sketch in this case (no need of a stricter design, it's just for readability).

Copy link
Contributor

@rsora rsora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@cmaglie cmaglie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just added some suggestions for some possible small refactoring/code cleaning.

Anyway the PR looks good, nice work!

// SketchCopyAdditionalFiles copies the additional files for a sketch to the
// specified destination directory.
func SketchCopyAdditionalFiles(sketch *sketch.Sketch, destPath string) error {
if err := os.MkdirAll(destPath, os.FileMode(0755)); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at some point we may think to replace those path strings with paths.Path objects that have a much cleaner API to handle file operations.

// MergeSketchSources merges all the source files included in a sketch
func MergeSketchSources(sketch *sketch.Sketch) (int, string) {
// SketchMergeSources merges all the source files included in a sketch
func SketchMergeSources(sketch *sketch.Sketch) (int, string) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if these functions (SketchMergeSources, SketchCopyAdditionalFiles, etc.) may become methods of sketch.Sketch?

@masci masci merged commit f3efd0c into master Jul 30, 2019
@masci masci deleted the massi/refact branch July 30, 2019 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants